"""
标签编码：
    根据特征值的位置，将字符串转为数值
"""
import numpy as np
import  sklearn.preprocessing as sp

raw_sample = np.array(['bmw','benzi','audi','bmw','qq'])

encoder = sp.LabelEncoder()
res = encoder.fit_transform(raw_sample)
print(res)
